<template>
  <page-header-wrapper :title="false">
    <a-card>
      <div class="table-page-search-wrapper">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="6" :sm="24">
              <a-form-item label="出库门店">
                <a-select v-model="queryParam.brand">
                  <a-select-option value="0">所有门店</a-select-option>
                  <a-select-option value="1">达臻贸易王升</a-select-option>
                  <a-select-option value="2">达臻东街店</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="24">
              <a-form-item label="回收商">
                <a-select v-model="queryParam.brand">
                  <a-select-option value="0">所有回收商</a-select-option>
                  <a-select-option value="1">阿美科技</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <template v-if="advanced">
              <a-col :md="6" :sm="24">
                <a-form-item label="订单状态">
                  <a-select v-model="queryParam.brand">
                    <a-select-option value="0">所有状态</a-select-option>
                    <a-select-option value="1">未完成</a-select-option>
                    <a-select-option value="1">已完成</a-select-option>
                    <a-select-option value="1">已取消</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :md="6" :sm="24">
                <a-form-item label="出库时间">
                  <a-range-picker :value="value4" />
                </a-form-item>
              </a-col>
              <a-col :md="6" :sm="24">
                <a-form-item label="筛选">
                  <a-input :value="value" placeholder="请输入" />
                </a-form-item>
              </a-col>
            </template>
            <a-col :md="(!advanced && 8) || 24" :sm="24">
              <span
                class="table-page-search-submitButtons"
                :style="(advanced && { float: 'right', overflow: 'hidden' }) || {}"
              >
                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button>
                <a @click="toggleAdvanced" style="margin-left: 8px">
                  {{ advanced ? '收起' : '展开' }}
                  <a-icon :type="advanced ? 'up' : 'down'" />
                </a>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <a-table ref="table" size="default" rowKey="key" :columns="columns" :data="loadData">
        <span slot="serial" slot-scope="text, record, index">
          {{ index + 1 }}
        </span>
      </a-table>
    </a-card>
  </page-header-wrapper>
</template>

<script>
export default {
  name: 'SecondhandOutOrder',
  data() {
    return {
      mdl: null,
      visible: false,
      value: '',
      value4: '',
      confirmLoading: false,
      // 高级搜索 展开/关闭
      advanced: false,
      // 查询参数
      queryParam: {},
      // 表头
      columns: [
        {
          title: '订单ID',
          dataIndex: 'no1',
        },
        {
          title: 'SN码',
          dataIndex: 'no2',
        },
        {
          title: '品牌',
          dataIndex: 'no3',
        },
        {
          title: '机型',
          dataIndex: 'no4',
        },
        {
          title: '收款状态',
          dataIndex: 'no5',
        },
        {
          title: '退货门店',
          dataIndex: 'no7',
        },
        {
          title: '退货人',
          dataIndex: 'no7',
        },
        {
          title: '退货金额',
          dataIndex: 'no7',
        },
        {
          title: '回收价',
          dataIndex: 'no7',
        },
        {
          title: '回收时间',
          dataIndex: 'no7',
        },
        {
          title: '退货时间',
          dataIndex: 'status',
        },
        {
          title: '操作',
          dataIndex: 'status',
        },
      ],
      // 加载数据方法 必须为 Promise 对象
      loadData: [],
    }
  },
  methods: {
    toggleAdvanced() {
      this.advanced = !this.advanced
    },
  },
}
</script>
